var OrderCollection = Backbone.Collection.extend({
	model: OrderModel,
	url: basePath + '/order',
	
	fetch: function (id) {
		this.url = this.url + '/'+ id + '?key=' + router.apikey;
		Backbone.Collection.prototype.fetch.apply(this, arguments);
	},
	parse: function (data, opts) {
		return data.data;
	},
	
	
	
	add_old: function(record) {		
		var item = _.find(this.models,	function(param) {
			return record.get('itemId') === param.get('itemId')
			} , this);
		if(item === undefined)	{
			this.add(record);			
		} else {
			record.set('counter', record.get('counter') + 1);
		}
	}
	

});

